<template>
	<view class="container">
		<view class="title">{{info.title}}</view>
		<view class="flex justify-end mb-50">
			<text class="time">{{info.time|time}}</text>
		</view>
		<!-- <view class="desc" v-if="(info.title_d).trim()">{{info.title_d}}</view> -->
		<view class="detail-cc">
			<rich-text :nodes="content"></rich-text>
		</view>

		<!-- <view style="color:#cccccc;">
			免责声明：<br>本文版权归第三方作者所有，相关授权事宜请联系原作者。文中观点均来自原作者，不代表本平台观点及立场。特别提醒，本文内容仅供参考，不作为实际操作建议，交易风险自担。
		</view> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				info: {},
				content: ''
			};
		},
		onLoad() {
			const new_info = uni.getStorageSync('new_info'); // 尝试读取storage
			
			this.info = JSON.parse(new_info)
			// console.log("this.info", this.info)
			this.content = this.info.content.replace(/auto/g, '100%')

			this.content = this.content.replace(/<p style="/g, '<p style="margin: 20px 0;')
			this.content = this.content.replace(/<img/g, '<img style="max-width: 100%;"')
			console.log(this.content)
			// this.content = this.content.replace(/<p/g,'<p class="c_p"')
		}
	}
</script>

<style lang="scss">
	.container {
		// padding: 30rpx;
		padding: 40rpx 60rpx;
		background-color: #fff;

		.title {
			font-size: 50rpx;
			color: #333;
			margin-bottom: 50rpx;
		}

		.time {
			font-size: 24rpx;
			color: #999;
		}

		.desc {
			margin-bottom: 50rpx;
			padding: 60rpx;
			border-radius: 5rpx;
			background-color: $color-gray;
		}

		.mb-50 {
			margin-bottom: 50rpx;
		}

		.content {
			padding: 30rpx 0;
		}

		.detail-cc {
			line-height: 2;
			color: #666;
			font-size: 16px;

		}

	}
</style>
